﻿// Copyright (c) 2014 Morten Bakkedal
// This code is published under the MIT License.

using System;

using FuncLib.Functions;

namespace FuncLib.DualFunctions
{
	/// <summary>
	/// To make the forward-mode approach work seamlessly with the default reverse-mode, each
	/// <see cref="DualVariable" /> instance may be implicitly converted to an instance of this
	/// class deriving from <see cref="Variable" /> (and back again using the
	/// <see cref="OuterVariable" /> property).
	/// </summary>
	[Serializable]
	public class DualInnerVariable : Variable
	{
		public DualInnerVariable(string name, DualVariable outerVariable)
			: base(name)
		{
			OuterVariable = outerVariable;
		}

		public DualVariable OuterVariable
		{
			get;
			private set;
		}
	}
}
